package com.fsnbigdata.service.impl;
import com.fsnbigdata.service.api.SpecimenImageService;
import org.springframework.roo.addon.layers.service.annotations.RooServiceImpl;
import com.fsnbigdata.domain.Specimen;
import com.fsnbigdata.domain.SpecimenImage;
import com.fsnbigdata.repository.SpecimenImageRepository;
import io.springlets.data.domain.GlobalSearch;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * = SpecimenImageServiceImpl
 *
 * TODO Auto-generated class documentation
 *
 */
@RooServiceImpl(service = SpecimenImageService.class)
@Service
@Transactional(readOnly = true)
public class SpecimenImageServiceImpl implements SpecimenImageService {

    /**
     * TODO Auto-generated attribute documentation
     *
     */
    private SpecimenImageRepository specimenImageRepository;

    /**
     * TODO Auto-generated constructor documentation
     *
     * @param specimenImageRepository
     */
    @Autowired
    public SpecimenImageServiceImpl(SpecimenImageRepository specimenImageRepository) {
        setSpecimenImageRepository(specimenImageRepository);
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @return SpecimenImageRepository
     */
    public SpecimenImageRepository getSpecimenImageRepository() {
        return specimenImageRepository;
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @param specimenImageRepository
     */
    public void setSpecimenImageRepository(SpecimenImageRepository specimenImageRepository) {
        this.specimenImageRepository = specimenImageRepository;
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @param entity
     * @return SpecimenImage
     */
    @Transactional
    public SpecimenImage save(SpecimenImage entity) {
        return getSpecimenImageRepository().save(entity);
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @param id
     * @return SpecimenImage
     */
    public SpecimenImage findOne(Long id) {
        return getSpecimenImageRepository().findOne(id);
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @param id
     * @return SpecimenImage
     */
    public SpecimenImage findOneForUpdate(Long id) {
        return getSpecimenImageRepository().findOneDetached(id);
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @param ids
     * @return List
     */
    public List<SpecimenImage> findAll(Iterable<Long> ids) {
        return getSpecimenImageRepository().findAll(ids);
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @param specimen
     * @param globalSearch
     * @param pageable
     * @return Page
     */
    public Page<SpecimenImage> findBySpecimen(Specimen specimen, GlobalSearch globalSearch, Pageable pageable) {
        return getSpecimenImageRepository().findBySpecimen(specimen, globalSearch, pageable);
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @param specimen
     * @return Long
     */
    public long countBySpecimen(Specimen specimen) {
        return getSpecimenImageRepository().countBySpecimen(specimen);
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @return Class
     */
    public Class<SpecimenImage> getEntityType() {
        return SpecimenImage.class;
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @return Class
     */
    public Class<Long> getIdType() {
        return Long.class;
    }
}
